package com.ww.springboot.boot.thread.study.base.lock.demo;

import java.util.concurrent.locks.ReentrantLock;

/**
 * 描述：多把锁之前是否会竞争
 * 结论:  锁之间互不干扰
 *
 * @author 🧑 ‍wanwei
 * @since 2022-08-05 17:45
 */
public class AqsDemo1 {


    /**
     * 创建三把锁 锁之间互不干扰
     */
    private static ReentrantLock lock = new ReentrantLock();
    private static ReentrantLock lock2 = new ReentrantLock();
    private static ReentrantLock lock3 = new ReentrantLock();


    public static void main(String[] args) {
        lock.lock();
        lock2.lock();
        lock3.lock();

        lock2.unlock();
    }
}
